<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TCH业务查询管理</title>
<%
	// 权限验证
	if(session.getAttribute("currentMemberShip")==null){
		response.sendRedirect("login.jsp");
		return;
	}
%>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
    var page=0;
    var lasttime;
    var beforetime;
    
    function getCommonData() {
    	var district = $("#district").combotree("getText");
    	var Direction = $("#Direction").combotree("getValue");
    	
		var startTime = $("#i1").datebox("getValue");
		var endTime = $("#i2").datebox("getValue");
		var IMSI = '';
		var MSISDN = '';
		var CTCS_ID = '';
		if ($('#in1').searchbox('getName') == 'IMSI') {
			IMSI = $('#in1').searchbox('getValue');
		} else if ($('#in1').searchbox('getName') == 'MSISDN') {
			MSISDN = $('#in1').searchbox('getValue');
		} else if ($('#in1').searchbox('getName') == 'CTCS_ID') {
			CTCS_ID = $('#in1').searchbox('getValue');
		}
		var UmType = $("#UmType").combotree("getText");
		
		var kilometerStart = $("#kilometerStart").val();
		var kilometerStart2 = $("#kilometerStart2").val();
		
		if (kilometerStart2.length == 2) {
			kilometerStart2 = '0' + kilometerStart2;
		} else if (kilometerStart2.length == 1) {
			kilometerStart2 = '00' + kilometerStart2;
		} else if (kilometerStart2.length == 0 && kilometerStart.length > 0) {
			kilometerStart2 = '000' + kilometerStart2;
		}
		var kilometerStartLong = kilometerStart + kilometerStart2;
		
		var kilometerEnd  = $("#kilometerEnd").val();
		var kilometerEnd2 = $("#kilometerEnd2").val();
		if (kilometerEnd2.length == 2) {
			kilometerEnd2 = '0' + kilometerEnd2;
		} else if (kilometerEnd2.length == 1) {
			kilometerEnd2 = '00' + kilometerEnd2;
		} else if (kilometerEnd2.length == 0 && kilometerEnd.lenght > 0) {
			kilometerEnd2 = '000' + kilometerEnd2;
		}
		var kilometerEndLong = kilometerEnd +kilometerEnd2;
		
		startDate = new Date(startTime.replace(new RegExp("-","gm"),"/"));
		endDate = new Date(endTime.replace(new RegExp("-","gm"),"/"));
		var startTimeLong = startDate.getTime();
		var endTimeLong = endDate.getTime();

		var recordId = $("#recordId").val()
		return {"startTime":startTimeLong, "endTime":endTimeLong, "IMSI":IMSI, "MSISDN":MSISDN, "CTCS_ID":CTCS_ID, "recordId": recordId,
			"UmType":UmType, "district":district, "kilometerStart":kilometerStartLong, "kilometerEnd":kilometerEndLong, "Direction": Direction};
    }
    
	function searchTCH(){
		page=1;
		var data = getCommonData();
		if (data.endTime > new Date()) {
			$.messager.alert("系统提示","查询结束时间不能大于当前时间！");
			return;
		}
		if(data.startTime - data.endTime > 0){
			$.messager.alert("系统提示","查询开始时间不能大于结束时间！");
			return;
		}
		if(data.kilometerStart - data.kilometerEnd > 0){
			$.messager.alert("系统提示","公里标下限值不能大于公里标上限值！");
			return;
		}
		
		sendData(data, page, '1');

		$("#myDiv").html('');
	}
	
	function searchBack(){
		if(page==1){
			$.messager.alert("系统提示","当前页已经是第一页！");
			return;
		}

		var data = getCommonData();
		
		var rowsbefore = $('#dg').datagrid("getRows"); 
		if (rowsbefore.length > 0) {
			data.endTime = rowsbefore[0].timeStamp;
		} else{
			data.endTime = lasttime+1; //因为数据库取数据时，时间取大于
		}
		if(data.startTime - data.endTime > 0){
			$.messager.alert("系统提示","查询开始时间不能大于结束时间！");
			return;
		}
		if(data.kilometerStart - data.kilometerEnd > 0){
			$.messager.alert("系统提示","公里标下限值不能大于公里标上限值！");
			return;
		}
		page=page-1;
		
		sendData(data, page, '0');
	}
	
	function sendData(data, page, increase) {
		
		var currentpage="第 "+page+" 页";
		var p = $('#dg').datagrid('getPager');
		$(p).pagination({ //设置分页页数
			displayMsg:currentpage
		});
		console.log(new Date(data.startTime));
		console.log(new Date(data.endTime));
		$("#dg").datagrid('load',{
			"startTime":data.startTime,
			"endTime":data.endTime,
			"IMSI":data.IMSI,
			"MSISDN":data.MSISDN,
			"CTCS_ID":data.CTCS_ID,
			"UmType":data.UmType,
			"district":data.district,
			"kilometerStart":data.kilometerStart,
			"kilometerEnd":data.kilometerEnd,
			"search":'1',
			"recordId": data.recordId,
			"direction": data.Direction,
			"increase":increase
		});
	}
	
	function searchNext(){
		var size=$("#dg" ).datagrid("getPager" ).data("pagination" ).options.pageSize;
		var rows  = $('#dg').datagrid("getRows");  
		if(rows.length<size){
			$.messager.alert("系统提示","当前页已经是最后一页！");
			return;
		} else {
			lasttime=rows[rows.length-1].timeStamp;
			beforetime=rows[0].timeStamp;
		}

		var data = getCommonData();
		
		data.startTime = lasttime;
		if(data.startTime -data.endTime > 0){
			$.messager.alert("系统提示","查询开始时间不能大于结束时间！");
			return;
		}
		if(data.kilometerStart - data.kilometerEnd > 0){
			$.messager.alert("系统提示","公里标下限值不能大于公里标上限值！");
			return;
		}
		page=page+1;
		
		sendData(data, page, '1');
	}
	
	function openTCHAddDialog(){
		 $("#dlg").dialog("open").dialog("setTitle","添加TCH信息");
		 $("#flag").val(1);
		 $("#primaryKey").attr("readonly",false);
	}
	
	function openTCHModifyDialog(){
		 var selectedRows=$("#dg").datagrid("getSelections");
		 if(selectedRows.length!=1){
			 $.messager.alert("系统提示","请选择一条要编辑的数据！");
			 return;
		 }
		 var row=selectedRows[0];
		 $("#dlg").dialog("open").dialog("setTitle","编辑TCH信息");
		 $("#fm").form("load",row);
		 $("#flag").val(2);
		 $("#id").attr("readonly",true);
	}
	
	function save() {
		$("#fm").form("submit",{
			url:"${pageContext.request.contextPath}/tch/save.do",
			onSubmit:function(){
				return $(this).form("validate");
			},
			success:function(result){
				var result=eval('('+result+')');
				if(result.success){
					$.messager.alert("系统提示","保存成功！");
					resetValue();
					$("#dlg").dialog("close");
					$("#dg").datagrid("reload");
				}else{
					$.messager.alert("系统提示","保存失败！");
					return;
				}
			}
		 });
	}
	
	function checkData(){
		var flag=$("#flag").val();
		if(flag==1){
			$.post("${pageContext.request.contextPath}/tch/exisPrimaryKey.do",{primaryKey:$("#primaryKey").val()},function(result){
				if(result.exist){
					 $.messager.alert("系统提示","该PrimaryKey已存在，请更换下！");
					 $("#primaryKey").focus();
				}else{
					save();
				}
			},"json");
		}else{
			save();
		}
	}
	
	function resetValue(){
		 $("#primaryKey").val("");
		 $("#timeStamp").val("");
		 $("#startTime").val("");
		 $("#frontProcessorId").val("");
		 $("#recordId").val("");
		 $("#logicChannel").val("");
		 $("#MSISDN").val("");
		 $("#direction").val("");
		 $("#frameNumber").val("");
		 $("#siteName").val("");
		 $("#decode").val("");
		 $("#rawMessage").val("");
		 $("#BCCH").val("");
		 $("#TCHData").val("");
		 $("#IMSI").val("");
		 $("#kilometer").val("");
		 $("#speed").val("");
		 $("#CTCS_ID").val("");
		 $("#ENGINE_ID").val("");
		 $("#CI").val("");
		 $("#LAC").val("");
		 $("#MS_TYPE").val("");
		 $("#message_TYPE").val("");
		 $("#sourceData").val("");
		 $("#TCH").val("");
		 $("#IMEI").val("");
		 $("#TA").val("");
		 $("#TCH_FRAME").val("");
		 $("#timeSlot").val("");
		 $("#TMSI").val("");
		 $("#channel").val("");
		 $("#HDLCData").val("");
		 $("#NPDUInfo").val("");
		 $("#HDLCMessage").val("");
	}
	
	function closeDialog(){
		 $("#dlg").dialog("close");
		 resetValue();
	}
	
	function deleteTCH(){
		 var selectedRows=$("#dg").datagrid("getSelections");
		 if(selectedRows.length==0){
			 $.messager.alert("系统提示","请选择要删除的数据！");
			 return;
		 }
		 var strIds=[];
		 for(var i=0;i<selectedRows.length;i++){
			 strIds.push(selectedRows[i].primaryKey);
		 }
		 var ids=strIds.join(",");
		 $.messager.confirm("系统提示","您确定要删除这<font color=red>"+selectedRows.length+"</font>条数据吗？",function(r){
			if(r){
				$.post("${pageContext.request.contextPath}/tch/delete.do",{primaryKeys:ids},function(result){
					if(result.success){
						 $.messager.alert("系统提示","数据已成功删除！");
						 $("#dg").datagrid("reload");
					}else{
						$.messager.alert("系统提示","数据删除失败，请联系系统管理员！");
					}
				},"json");
			} 
		 });
	}
	
	function postExcelFile(params, url) { //params是post请求需要的参数，url是请求url地址
	    var form = document.createElement("form");
	    form.style.display = 'none';
	    form.action = url;
	    form.method = "post";
	    document.body.appendChild(form);

	    for(var key in params){
	      var input = document.createElement("input");
	      input.type = "hidden";
	      input.name = key;
	      input.value = params[key];
	      form.appendChild(input);
	    }

	    form.submit();
	    form.remove();
	  }
	function exportTCHInCurrentPage(){
		var rows  = $('#dg').datagrid("getRows");
		if (rows.length < 1) {
			$.messager.alert("系统提示", "请查询需要导出的数据");
			return;
		}
    	var params = {data:JSON.stringify(rows)};
    	postExcelFile(params, "${pageContext.request.contextPath}/tch/exportcurrentpage.do");
	}
	function exportByTemplateInCurrentPage(){
		var rows = $("#dg").datagrid("getRows");
		var strIds=[];
		 for(var i=0;i<rows.length;i++){
			 strIds.push(rows[i].primaryKey);
		 }
		 var ids=strIds.join(",");
		 window.open('${pageContext.request.contextPath}/tch/exportByTemplate.do?ids='+ids+'');
	}
	
	function exportTCHInAllPages(){
		
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/tch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI+'&MSISDN='+data.MSISDN+'&recordId='+data.recordId+
				'&direction='+data.Direction+'&CTCS_ID='+data.CTCS_ID+'&UmType='+data.UmType+'&district='+data.district+'&kilometerStart='+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd);
	}
	function exportSDCCHInAllPages(){
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/sdcch_facch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI+'&MSISDN='+data.MSISDN+'&CTCS_ID='+data.CTCS_ID+'&district='+data.district+'&kilometerStart='+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd+'&recordId='+data.recordId);
	}
	function exportSACCHInAllPages(){
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/sacch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI+'&MSISDN='+data.MSISDN+'&CTCS_ID='+data.CTCS_ID+'&district='+data.district+'&kilometerStart='+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd+'&recordId='+data.recordId);
	}
	function exportByTemplateInAllPages(){
		 window.open('${pageContext.request.contextPath}/tch/exportByTemplate.do?ids='+null+'');
	}
	
	function openUploadFileDialog(){
		$("#dlg2").dialog('open').dialog('setTitle','批量导入数据');
	}
	
	function downloadTemplate(){
		window.open('template/tchExportTemplate.xls');
	}
	
	function uploadFile(){
		$("#uploadForm").form("submit",{
			success:function(result){
				var result=eval('('+result+')');
				if (result.errorMsg) {
					$.messager.alert("系统提示",result.errorMsg);
				} else {
					$.messager.alert("系统提示","上传成功");
					$("#dlg2").dialog("close");
					$("#dg").datagrid("reload");
				}
			}
		});
	}
	
	function formatDatebox(value) {
		var datetimeType = '';
		var date =new Date(parseInt(value));
		datetimeType = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate() +' '+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds()+' '+date.getMilliseconds();
		if(datetimeType != 'NaN-NaN-NaN NaN:NaN:NaN NaN')
			return datetimeType;
	}
	
	function formatKilometer(value) {
		if(value.length > 3) {
			var start = value.substring(0,value.length-3);
			var end = value.substring(value.length-3, value.length);
			return 'k' + start + '+' + end;
		}
		else {
			return value;
		}
	}
	
	function formatSignalName(value) {
		if (value.indexOf('Message') == -1) return value;
		
		var message = value.substr(7,3).trim();
		
		var result = message;
		
		if (message == '129') {
			result = 'M' + message +  ': ' + 'Validated Train Data';
		} else if (message == '130') {
			result = 'M' + message +  ': ' + 'Request for Shunting';
		} else if (message == '132') {
			result = 'M' + message +  ': ' + 'MA Request';
		} else if (message == '136') {
			result = 'M' + message +  ': ' + 'Train Position Report';
		} else if (message == '137') {
			result = 'M' + message +  ': ' + 'Request to stop earlier is granted';
		} else if (message == '138') {
			result = 'M' + message +  ': ' + 'Request to stop earlier is rejected';
		} else if (message == '146') {
			result = 'M' + message +  ': ' + 'Acknowledgement';
		} else if (message == '147') {
			result = 'M' + message +  ': ' + 'Acknowledgement of Emergency Stop';
		} else if (message == '149') {
			result = 'M' + message +  ': ' + 'Track Ahead Free Granted';
		} else if (message == '150') {
			result = 'M' + message +  ': ' + 'End of Mission';
		} else if (message == '153') {
			result = 'M' + message +  ': ' + 'Radio in-fill request';
		} else if (message == '154') {
			result = 'M' + message +  ': ' + 'No compatible version';
		} else if (message == '155') {
			result = 'M' + message +  ': ' + 'Initiation of a communication session';
		} else if (message == '156') {
			result = 'M' + message +  ': ' + 'Termination of a communication session';
		} else if (message == '157') {
			result = 'M' + message +  ': ' + 'SoM Position Report';
		} else if (message == '159') {
			result = 'M' + message +  ': ' + 'Session Established';
		} else if (message == '2') {
			result = 'M' + message +  ': ' + 'SR Authorisation';
		} else if (message == '3') {
			result = 'M' + message +  ': ' + 'Movement Authority';
		} else if (message == '6') {
			result = 'M' + message +  ': ' + 'Recognition of exit from TRIP mode';
		} else if (message == '8') {
			result = 'M' + message +  ': ' + 'Acknowledgement of Train Data';
		} else if (message == '9') {
			result = 'M' + message +  ': ' + 'Request to Stop Earlier';
		} else if (message == '15') {
			result = 'M' + message +  ': ' + 'Conditional Emergency Stop';
		} else if (message == '16') {
			result = 'M' + message +  ': ' + 'Unconditional Emergency Stop';
		} else if (message == '18') {
			result = 'M' + message +  ': ' + 'Revocation of Emergency Stop';
		} else if (message == '24') {
			result = 'M' + message +  ': ' + 'General message';
		} else if (message == '27') {
			result = 'M' + message +  ': ' + 'SH Refused';
		} else if (message == '28') {
			result = 'M' + message +  ': ' + 'SH Authorised';
		} else if (message == '33') {
			result = 'M' + message +  ': ' + 'MA with Shifted Location Reference';
		} else if (message == '34') {
			result = 'M' + message +  ': ' + 'Track Ahead Free Request';
		} else if (message == '37') {
			result = 'M' + message +  ': ' + 'In-fill MA';
		} else if (message == '40') {
			result = 'M' + message +  ': ' + 'Train outside controlled area';
		} else if (message == '32') {
			result = 'M' + message +  ': ' + 'Configuration Determination';
		} else if (message == '38') {
			result = 'M' + message +  ': ' + 'Initiation of a communication session';
		} else if (message == '39') {
			result = 'M' + message +  ': ' + 'Acknowledgement of termination of a communication session';
		} else if (message == '41') {
			result = 'M' + message +  ': ' + 'Train Accepted';
		} else if (message == '43') {
			result = 'M' + message +  ': ' + 'SoM position report confirmed by RBC';
		} else if (message == '45') {
			result = 'M' + message +  ': ' + 'Assignment of coordinate system';
		}
		return result;
	}

	function formatRawMessage(value) {
		return JSON.stringify(value);
	}
	
	function formatDirection(value) {
		if(value==1){
			return "ATP->RBC";
		}else if(value == 0){
			return "RBC->ATP";
		}
	}
	
	function formatLogicChannel(value) {
		if(value==0){
			return "FrequencySpectrum";
		}else if(value==1){
			return "SDCCH";
		}else if(value==2){
			return "SACCH";
		}else if(value==3){
			return "TCH";
		}else if(value==4){
			return "SACCH_WITH_TCH";
		}else if(value==5){
			return "FACCH";
		}else if(value==7){
            return "BCCH";
        }else if(value==8){
            return "AGCH";
        }
		else return value;
	}

	
	//重写分页
	$(function(){
		
	    $('#dg').datagrid({

			remoteSort:false,
	    	
	    	onClickRow: function(index,row){
				$("#myDiv").html('');
	    		var messageType = row.signalType;

	    		var UUID = row.UUID;
	    		var timeStamp = timestampToTime(row.timeStamp);
	    		//console.log(row);
	    		$.post("${pageContext.request.contextPath}/tch/findMessageType.do",{messageType:messageType, UUID:UUID, timeStamp:timeStamp},function(result){
	    			//console.log(result);
	    			var messageContent = result.messageContent;
					console.log(messageContent);
					if (messageContent == null) return;
					var resultStr = '';
					
					if (messageType == 'HDLC') { 
						
						resultStr += messageContent.id ? 'type: ' + messageContent.id + '\n' : 'type: 0\n';
						resultStr += messageContent.hdlcInfor ? '该层信息：0x' + messageContent.hdlcInfor + '\n' : '';
						resultStr += '信号类型：HDLC\n';
						resultStr += messageContent.flag ? '标志序列（Flag）：' + parseInt(messageContent.flag, 2) + '\n' : '';
						resultStr += messageContent.address ? '地址域：' + parseInt(messageContent.address, 2) + '\n' : '';
						resultStr += messageContent.control ? '控制域：' + parseInt(messageContent.control, 2) + '\n' : '';
						resultStr += messageContent.NR ? '接收顺序编号N(R)：' + parseInt(messageContent.NR, 2) + '\n' : '';
						resultStr += messageContent.NR ? '信息域: 0x' + parseInt(messageContent.information, 2) + '\n' : '';
						resultStr += messageContent.P_E ? '探寻位P/F：' + parseInt(messageContent.p_F, 2) + '\n' : '';
						resultStr += messageContent.FCS ? '帧校验域：' + parseInt(messageContent.FCS, 2) + '\n' : '';
						resultStr += messageContent.NS ? '发送顺序编号N（S）：' + parseInt(messageContent.NS, 2) + '\n' : '';
						resultStr += messageContent.hdlcStyle ? 'HDLC数据类型：' + messageContent.hdlcStyle + '\n' : '';
						console.log(resultStr);
						//$.messager.alert(resultStr);
						
					} else if (messageType == 'NPDU') {
						
						resultStr += messageContent.id ? 'type: ' + messageContent.id + '\n' : 'type: 0\n';
						resultStr += messageContent.npduInfor ? '该层信息：0x' + messageContent.npduInfor + '\n' : '';
						resultStr += '信号类型：NPDU\n';
						resultStr += messageContent.header ? '头部信息：0x' + parseInt(messageContent.header, 2).toString(16) + '\n' : '';
						resultStr += messageContent.hasNext ? '有无后来数据：有' + '\n' : '有无后来数据：无' + '\n';
						console.log(resultStr);
						
					} else if (messageType == 'TPDU') {

						resultStr += messageContent.id ? 'type: ' + messageContent.id + '\n' : 'type: 0\n';
						resultStr += messageContent.tpduInfor ? '该层信息：0x' + messageContent.tpduInfor + '\n' : '';
						resultStr += '信号类型：TPDU\n';
						resultStr += messageContent.hasNext ? '有无后来数据：有' + '\n' : '有无后来数据：无' + '\n';
						resultStr += messageContent.header ? '头部信息：0x' + parseInt(messageContent.header, 2).toString(16) + '\n' : '';
						resultStr += messageContent.TPDUtype ? 'TPDU类型：' + messageContent.TPDUtype + '\n' : '';
						resultStr += messageContent.TPDU_NR ? 'TPDU发送序列码: ' + parseInt(messageContent.TPDU_NR, 2) + '\n' : '';
						resultStr += messageContent.TPDU_NR ? '长度指示器（LI域）' + parseInt(messageContent.LI, 2) + '\n' : '';
						resultStr += messageContent.data ? '信息域: 0x' + parseInt(messageContent.data, 2).toString(16) + '\n' : '';
						console.log(resultStr);
						
					} else if (messageType == 'SaPDU') {
						
						resultStr += messageContent.id ? 'type: ' + messageContent.id + '\n' : 'type: 0\n';
						resultStr += messageContent.sapduInfor ? '该层信息: 0x' + messageContent.sapduInfor + '\n' : '';
						resultStr += '信号类型: SaPDU\n';
						resultStr += messageContent.header ? '头部信息: 0x' + parseInt(messageContent.header, 2).toString(16) + '\n' : '';
						resultStr += messageContent.userData ? '信息域: 0x' + parseInt(messageContent.userData, 2).toString(16) + '\n' : '';
						resultStr += messageContent.MAC ? 'MAC域: 0x' + parseInt(messageContent.MAC, 2).toString(16) + '\n' : '';
						resultStr += messageContent.sapduType ? 'SaPDU类型: ' + messageContent.sapduType + '\n' : '';
						console.log(resultStr);
						
					} else if (messageType == 'APDU') {

						resultStr += formatTCHMessage('信息标识号', messageContent.message, false);
						resultStr += messageContent.apduInfor ? '该层信息: 0x' + messageContent.apduInfor + '\n' : '';
						resultStr += '信号类型: APDU\n';
						resultStr += formatTCHMessage('包含域1至域6的信息长度', messageContent.l_MESSAGE, true);
						resultStr += messageContent.t_TRAIN ? '列车的时间戳（T_TRAIN）: ' + parseInt(messageContent.t_TRAIN, 2) + '0' + '\n' : '';
						resultStr += messageContent.t_TRAIN_Time ? '列车的时间戳（T_TRAIN_Time）: ' + parseInt(messageContent.t_TRAIN_Time, 2) + '0' + '\n' : '';
						resultStr += formatTCHMessage('列车身份', messageContent.NID_ENGINE, true);
						resultStr += formatTCHMessage('指示消息是否需要车载设备作出应答', messageContent.m_ACK, true);
						//resultStr += formatTCHMessage('最后相关应答器组的标识号', messageContent.NID_LRBG, true);
						
						if (messageContent.NID_LRBG != null && messageContent.NID_LRBG.length > 20) {
							resultStr += formatTCHMessage('NID_C', messageContent.NID_LRBG.substring(0, 10), true);
							resultStr += formatTCHMessage('NID_BG', messageContent.NID_LRBG.substring(11), true);
						}
						resultStr += formatTCHMessage('紧急停车消息的标识号码', messageContent.NID_EM, true);
						resultStr += formatTCHMessage('紧急停车确认的标志', messageContent.q_EMERGENCYSTOP, true);
						resultStr += formatTCHMessage('本国或是地区的标识号', messageContent.NID_C, true);
						resultStr += formatTCHMessage('应答器组的分类号', messageContent.NID_BG, true);
						resultStr += formatTCHMessage('标志车是正在进入还是正在离开无线注入区域', messageContent.q_INFILL, true);
						resultStr += formatTCHMessage('SoM位置报告是否有效的标志', messageContent.q_STATUS, true);
						resultStr += formatTCHMessage('标识是否删除轨道描述', messageContent.q_TRACKDEL, true);
						resultStr += formatTCHMessage('标志距离的刻度信息', messageContent.q_SCALE, true);
						resultStr += formatTCHMessage('SR模式下可以运行的距离', messageContent.d_SR, true);
						resultStr += formatTCHMessage('LRBG和最新变化的位置信息的参考距离', messageContent.d_REF, true);
						resultStr += formatTCHMessage('标志传送信息的有效方向', messageContent.q_DIR, true);
						resultStr += formatTCHMessage('到紧急停车点的距离', messageContent.d_EMERGENCYSTOP, true);
						resultStr += messageContent.m_VERSION == '0010000' ? 'ETCS语言版本: Class 1\n' : formatTCHMessage('ETCS语言版本', messageContent.m_VERSION, true);
						resultStr += formatTCHMessage('分配给单个应答器组的坐标系', messageContent.q_ORIENTATION, true);
						resultStr += formatTCHMessage('轨道长度（此轨道是被显示出来的请求的前方空闲轨道）', messageContent.l_TAFDISPLAY, true);
						resultStr += formatTCHMessage('到显示前方轨道空闲请求的距离', messageContent.d_TAFDISPLAY, true);
						resultStr += formatTCHMessage('该应用层message中所包含的packet: 车-地信息包', messageContent.lablePacket, false);
						
						
						var contentPacket = messageContent.packet;
						if (contentPacket != null && contentPacket.length > 0) {

							var lablePackets = messageContent.lablePacket.split(",");
							
							for (var i = 0; i < contentPacket.length; i++) {
								var packet = contentPacket[i];
								resultStr += '包' + lablePackets[i] + ': \n';
								resultStr += formatTCHMessage('该应用层信息所包含的车-地信息所对应的message', packet.message, false);
								resultStr += formatTCHMessage('信息包的标识号', packet.NID_PACKET, true);
								resultStr += formatTCHMessage('包含信息包头在内的信息包的比特长度', packet.l_PACKET, true);
								resultStr += formatTCHMessage('标志距离的刻度信息', packet.q_SCALE, true);
								resultStr += formatTCHMessage('最后相关应答器组的标识号', packet.NID_LRBG, true);
								resultStr += formatTCHMessage('最后相关的应答器与估计的列车前端的距离', packet.d_LRBG, true);
								resultStr += formatTCHMessage('相对于LRBG方向的列车运行方向', packet.q_DIRLRBG, true);
								resultStr += formatTCHMessage('该限定词用于说明估计的前端位于LRBG的哪一侧', packet.q_DLRBG, true);
								resultStr += formatTCHMessage('L_DOUBTOVER置信区间下边界值和D_LRBG的估计值的差', packet.l_DOUBTOVER, true);
								resultStr += formatTCHMessage('低于读取的错误', packet.l_DOUBTUNDER, true);
								resultStr += formatTCHMessage('标志车完整性信息是否可用', packet.q_LENGTH, true);
								resultStr += formatTCHMessage('车的安全长度', packet.l_TRAININT, true);
								
								
								if (lablePackets[i].length > 5 && lablePackets[i].substring(5) == '00000000') {
									resultStr += '列车实际速度: ' + (parseInt(packet.v_TRAIN, 2) * 5) + '\n';
								} else {
									resultStr += formatTCHMessage('列车实际速度', packet.v_TRAIN, true);
								}
								
								resultStr += formatTCHMessage('相对于LRBG的定位，列车的运行方向', packet.q_DIRTRAIN, true);
								resultStr += formatTCHMessage('车载操作模式', packet.m_MODE, true);
								resultStr += formatTCHMessage('当前的工作等级', packet.m_LEVEL, true);
								resultStr += formatTCHMessage('STM标识号', packet.NID_STM, true);
							}
						}
						console.log(resultStr);
					}
					$("#myDiv").html(resultStr);
				},"json");
	    	}
	    }); 
	    
		
		var p = $('#dg').datagrid('getPager');
	    $(p).pagination({ //设置分页功能栏
	           //分页功能可以通过Pagination的事件调用后台分页功能来实现
	            //layout:['prev','next'],
                layout:['list','sep'],
                /* beforePageText: '第',//页数文本框前显示的汉字 
                afterPageText: '页', */
	            displayMsg:"",   
	            buttons:[{
	    			iconCls:'icon-undo',
	    			handler:function(){
	    				searchTCH();
	    			}
	    		},{
	    			iconCls:'icon-back',
	    			handler:function(){
	    				searchBack();
	    			}
	    		}, {
	    			iconCls:'icon-next',
	    			handler:function(){
	    				searchNext();
	    			}
	    		}]
	    });
	    
	    $('#UmType').combotree('loadData', [{id:'1000', text:'全选', children:[
	    	//{id:'0', text:'TCH_CSD'},
		    {id:'1', text:'HDLC'},
		    {id:'2', text:'NPDU'},
		    {id:'3', text:'TPDU'},
		    {id:'4', text:'SaPDU'},
		    {id:'5', text:'APDU'}]}]);
	    
	    $('#district').combotree({
	    	url: '${pageContext.request.contextPath}/sdcch/sdcchDistrictComboList.do'
	    });
	    
	    $('#i1').datetimebox('setValue', formatterDate(new Date(new Date(new Date().toLocaleDateString()).getTime())));
		$('#i2').datetimebox('setValue', formatterDate(new Date()));
		$('.searchbox-button').remove();
	});
	
	formatterDate = function (date) {
    	var day = date.getDate();
    	var month = (date.getMonth() + 1);
    	var hor = date.getHours();
    	var min = date.getMinutes();
    	var sec = date.getSeconds();
    	return date.getFullYear() + '-' + month + '-' + day+" "+hor+":"+min+":"+sec;
    };
	
	function timestampToTime(timestamp) {
        var date = new Date(timestamp-0);
        var Y = date.getFullYear() + '';
        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1);
        var D = date.getDate() < 10 ? '0'+(date.getDate()) : date.getDate();
        return Y+M+D;
    }
	
	function timeSort(a, b){
		return a > b ? 1 : -1; 
	}
	function recordSort(a, b) {
		if (a > b)
			return 1;
		else if (a < b)
			return -1;
		return 0; 
	}
	
	function formatTCHMessage(key, value, isBinary) {
		if (value == null || value.length < 1) return '';
		return key + ': ' + (isBinary ? parseInt(value, 2) : value) + '\n';
	}
	
</script>
</head>
<body style="margin: 1px">
	
<table id="dg" title="TCH业务查询" class="easyui-datagrid" fitColumns="fasle" pagination="true" rownumbers="true" pageSize="100" pageList="[100,200,300,400,500]"
   url="${pageContext.request.contextPath}/tch/list.do" fit="true" toolbar="#tb" singleSelect="true">
   <thead>
   	<tr>
   		<th field="cb" checkbox="true" align="center"></th>
   		<!-- <th field="timeStamp" width="80" align="center" formatter="formatDatebox">文件入库时间</th> -->
   		<th field="timeStamp" width="140" align="center" formatter="formatDatebox" sortable="true">触发时间</th>
   		<th field="IMSI" width="110" align="center">IMSI</th>
   		<!-- <th field="logicChannel" width="80" align="center" formatter="formatLogicChannel">LogicChannel</th> -->
   		<th field="MSISDN" width="90" align="center">MSISDN</th>
   		<th field="CTCS_ID" width="80" align="center">机车号</th>
   		
   		<th field="siteName" width="80" align="center">小区名称</th>
   		<th field="BCCH" width="80" align="center">BCCH</th>
   		<th field="TCH" width="80" align="center">TCH</th>
   		<th field="timeSlot" width="60" align="center">时隙号</th>
   		<th field="frameNumber" width="80" align="center">帧号</th>
   		<th field="direction" width="80" align="center" formatter="formatDirection" sortable="true">方向</th>
   		<th field="signalType" width="80" align="center">消息类型</th>
   		<th field="signalName" width="120" align="center" formatter="formatSignalName">消息名称</th>
   		<th field="HDLC" width="70" align="center">链路层</th>
   		<th field="LLayer" width="110" align="center">链路层(ATP->RBC)</th>
   		<th field="LLayer2" width="110" align="center">链路层(RBC->ATP)</th>
   		<th field="NLayer" width="80" align="center">网络层</th>
   		<th field="TLayer" width="80" align="center">传输层</th>
   		<th field="SLayer" width="80" align="center">安全层</th>
   		<th field="ALayer" width="150" align="center" formatter="formatSignalName">应用层</th>
   		<th field="CRCTest" width="60" align="center">CRC校验</th>
   		<th field="t_TRAIN" width="80" align="center">T_TRAIN</th>
   		<th field="LRBG" width="80" align="center">LRBG</th>
   		<th field="kilometer" width="80" align="center" formatter="formatKilometer">公里标</th>
   		<th field="speed" width="80" align="center">速度（km/h）</th>
   		<th field="length" width="60" align="center">数据长度</th>
		<th field="LEVEL" width="100" align="center">LEVEL</th>
		<th field="SNR" width="120" align="center">SNR(dB)</th>
		<th field="QUALITY" width="100" align="center">QUALITY</th>
   		<th field="TCH_FRAME" width="80" align="center">数据源码</th>
   		<th field="TMSI" width="80" align="center">TMSI</th>
   		<th field="LAC" width="80" align="center">LAC</th>
   		<th field="CI" width="80" align="center">CI</th>
   		<th field="frontProcessorId" width="80" align="center">前置机号</th>
   		<th field="recordId" width="80" align="center" sortable="true" sorter="recordSort">记录号</th>
   		<!-- <th field="frameNumber" width="80" align="center">帧号</th> -->
   		<!-- <th field="decode" width="80" align="center">Decode</th>
   		<th field="rawMessage" width="80" align="center" formatter="formatRawMessage">源信息</th> -->
   		<!-- <th field="IMEI" width="80" align="center">IMEI</th>
   		<th field="TA" width="80" align="center">TA</th>
   		<th field="TCH_FRAME" width="80" align="center">TCH_FRAME</th> -->
   		<th field="UUID" width="80" align="center">UUID</th>
   		<!-- <th field="channel" width="80" align="center">Channel</th>
   		<th field="HDLCData" width="80" align="center">HDLCData</th>
   		<th field="NPDUInfo" width="80" align="center">NPDUInfo</th>
   		<th field="HDLCMessage" width="80" align="center">HDLCMessage</th> -->
   		<!-- <th field="primaryKey" width="80" align="center">主键</th> -->
   	</tr>
   </thead>
 </table>
 <div id="tb">
 	<div style="margin:5px">
 		<a href="javascript:exportTCHInCurrentPage()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前页TCH数据</a>
 		<a href="javascript:exportTCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出所有页TCH数据</a>
 		<a href="javascript:exportSDCCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前条件所有信令数据</a>
 		<a href="javascript:exportSACCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前条件所有测量报告及系统消息</a>
 	</div>
 	<div>
 		&nbsp;&nbsp;小区：<select id="district" class="easyui-combotree" data-options="panelHeight:'auto', panelMaxHeight:'240px'" style="width:180px;" multiple></select>
  		&nbsp;&nbsp;时间：<input type="text" id="i1" style="width:calc(8%)" class="easyui-datetimebox"  />&nbsp;至&nbsp;
		<input type="text" id="i2" style="width:calc(8%)" class="easyui-datetimebox"/>
		
		
		&nbsp;&nbsp;方向
		<input type="text" class="easyui-combotree" id="Direction"  data-options="panelHeight:'auto', panelMaxHeight:'240px', data:[{id:'1000', text:'全选', 'children':[
					    {id:'0', text:'RBC->ATP'},
					    {id:'1', text:'ATP->RBC'}]}]" value="" style="width:130px" id="UmType" name="UmType" onkeydown="if(event.keyCode==13) searchTCH()" multiple/>
		
 		&nbsp;&nbsp;公里标：&nbsp;k
 		<input type="text" id="kilometerStart" style="width:35px" onkeydown="if(event.keyCode==13) searchTCH()"/>+<input type="text" id="kilometerStart2" style="width:35px" onkeydown="if(event.keyCode==13) searchTCH()"/>
 		&nbsp;至&nbsp;k
		<input type="text" id="kilometerEnd" style="width:35px" onkeydown="if(event.keyCode==13) searchTCH()"/>+<input type="text" id="kilometerEnd2" style="width:35px" onkeydown="if(event.keyCode==13) searchTCH()"/>
 		
 		&nbsp;&nbsp;Um接口信令类型：<select id="UmType" class="easyui-combotree" data-options="panelHeight:'auto', panelMaxHeight:'240px'" style="width:110px;" multiple></select>
 		&nbsp;&nbsp;记录号 ：<input type="text" style="width:calc(6%)" id="recordId" name="recordId" onkeydown="if(event.keyCode==13) searchTCH()"/>
 		
 		
 		&nbsp;&nbsp;<input id="in1" class="easyui-searchbox" data-options="prompt:'Please Input Value',menu:'#mm'" style="width:180px; margin-top:-20px"></input>
		<div id="mm">
			<div data-options="name:'IMSI'">IMSI</div>
			<div data-options="name:'MSISDN'">MSISDN</div>
			<div data-options="name:'CTCS_ID'">机车号</div>
		</div>
 		
 		<a href="javascript:searchTCH()" class="easyui-linkbutton" iconCls="icon-search" plain="true"><b style="font-size:15px">查询</b></a>
 	</div>
 	<textarea id="myDiv" style="width:99%; height:100px; margin:6px" readonly></textarea>
 </div>
 
 <div id="dlg" class="easyui-dialog" style="width:620px;height:250px;padding: 10px 20px" closed="true" buttons="#dlg-buttons">
   
   <form id="fm" method="post">
   	<table cellspacing="8px">
   		<tr>
   			<td>primaryKey：</td>
   			<td><input type="text" id="primaryKey" name="primaryKey" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>timeStamp：</td>
   			<td><input type="text" id="timeStamp" name="timeStamp" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>startTime：</td>
   			<td><input type="text" id="startTime" name="startTime" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>frontProcessorId：</td>
   			<td><input type="text" id="frontProcessorId" name="frontProcessorId" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>recordId：</td>
   			<td><input type="text" id="recordId" name="recordId" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>IMSI：</td>
   			<td><input type="text" id="IMSI" name="IMSI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>logicChannel：</td>
   			<td><input type="text" id="logicChannel" name="logicChannel" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>MSISDN：</td>
   			<td><input type="text" id="MSISDN" name="MSISDN" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>direction：</td>
   			<td><input type="text" id="direction" name="direction" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>frameNumber：</td>
   			<td><input type="text" id="frameNumber" name="frameNumber" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>siteName：</td>
   			<td><input type="text" id="siteName" name="siteName" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>decode：</td>
   			<td><input type="text" id="decode" name="decode" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>rawMessage：</td>
   			<td><input type="text" id="rawMessage" name="rawMessage" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>BCCH：</td>
   			<td><input type="text" id="BCCH" name="BCCH" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>layer：</td>
   			<td><input type="text" id="layer" name="layer" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>length：</td>
   			<td><input type="text" id="length" name="length" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>data：</td>
   			<td><input type="text" id="data" name="data" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>kilometer：</td>
   			<td><input type="text" id="kilometer" name="kilometer" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>speed：</td>
   			<td><input type="text" id="speed" name="speed" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>CI：</td>
   			<td><input type="text" id="CI" name="CI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>LAC：</td>
   			<td><input type="text" id="LAC" name="LAC" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>CTCS_ID：</td>
   			<td><input type="text" id="CTCS_ID" name="CTCS_ID" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>ENGINE_ID：</td>
   			<td><input type="text" id="ENGINE_ID" name="ENGINE_ID" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>MS_TYPE：</td>
   			<td><input type="text" id="MS_TYPE" name="MS_TYPE" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>message_TYPE：</td>
   			<td><input type="text" id="message_TYPE" name="message_TYPE" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>sourceData：</td>
   			<td><input type="text" id="sourceData" name="sourceData" class="easyui-validatebox" required="true"/></td>
   		</tr>
		<tr>
			<td>LEVEL：</td>
			<td><input type="text" id="LEVEL" name="LEVEL" class="easyui-validatebox" required="true"/></td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td>SNR：</td>
			<td><input type="text" id="SNR" name="SNR" class="easyui-validatebox" required="true"/></td>
		</tr>
		<tr>
			<td>QUALITY：</td>
			<td><input type="text" id="QUALITY" name="QUALITY" class="easyui-validatebox" required="true"/></td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		</tr>
   		<tr>
   			<td>ARFCN：</td>
   			<td><input type="text" id="ARFCN" name="ARFCN" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>RA：</td>
   			<td><input type="text" id="RA" name="RA" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>RF_Capability：</td>
   			<td><input type="text" id="RF_Capability" name="RF_Capability" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>TMSI_IMSI：</td>
   			<td><input type="text" id="TMSI_IMSI" name="TMSI_IMSI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>call_BCD_Num：</td>
   			<td><input type="text" id="call_BCD_Num" name="call_BCD_Num" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>LU_Type：</td>
   			<td><input type="text" id="LU_Type" name="LU_Type" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>timeSlot：</td>
   			<td><input type="text" id="timeSlot" name="timeSlot" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>TMSI：</td>
   			<td><input type="text" id="TMSI" name="TMSI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>channel：</td>
   			<td><input type="text" id="channel" name="channel" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>TCH：</td>
   			<td><input type="text" id="TCH" name="TCH" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>IMEI：</td>
   			<td><input type="text" id="IMEI" name="IMEI" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>l2：</td>
   			<td>
   			<input type="text" id="l2" name="l2" class="easyui-validatebox" required="true"/>
   			<input type="hidden" id="flag" name="flag"/>
   			</td>
   		</tr>
   	</table>
   </form>
 </div>
 
 <div id="dlg-buttons">
 	<a href="javascript:checkData()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
 	<a href="javascript:closeDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
 </div>
 
 <div id="dlg2" class="easyui-dialog" style="width:400px;height:180px;padding:10px 20px" closed="true" buttons="#dlg-buttons2">
        <form id="uploadForm" action="${pageContext.request.contextPath}/tch/upload.do" method="post" enctype="multipart/form-data">
        	<table>
        		<tr>
        			<td>下载模版：</td>
        			<td><a href="javascript:void(0)" class="easyui-linkbutton"  onclick="downloadTemplate()">导入模版</a></td>
        		</tr>
        		<tr>
        			<td>上传文件：</td>
        			<td><input type="file" name="tchUploadFile"></td>
        		</tr>
        	</table>
        </form>
	</div>
    
	<div id="dlg-buttons2">
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="uploadFile()">上传</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg2').dialog('close')">关闭</a>
	</div>
</body>
</html>